package com.zy.cat.entity.game;

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Index;
import javax.persistence.Table;

import com.zy.cat.entity.primary.TrunDrawHistoryPrimary;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 
 * @info 9趣猫大转盘中奖历史实体类
 * @author Link
 * @date 2019-10-30 09:14
 */
@Entity
@Table(name = "zy_cat_game_trun_draw_history", indexes = {
		@Index(name = "pid", columnList = "pid"),
		@Index(name = "fid", columnList = "fid"),
 		@Index(name = "ztype", columnList = "ztype"),
 		@Index(name = "dtype", columnList = "dtype"),
		@Index(name = "dstatus", columnList = "dstatus"),
		@Index(name = "ltime", columnList = "ltime")})
@Data
@AllArgsConstructor
@NoArgsConstructor
@IdClass(TrunDrawHistoryPrimary.class)
@ApiModel("9趣猫大转盘中奖历史实体类")
public class TrunDrawHistory {
	
	@Id
	@Column(columnDefinition = "VARCHAR(30) NOT NULL  COMMENT '创建时间[9趣猫大转盘中奖历史实体类]'")
	@ApiModelProperty(value = "创建时间", example = "2019-02-22 12:56:56:666")
	private String ctime;
	
	@Column(columnDefinition = "CHAR(32) NOT NULL  COMMENT '中奖翻倍ID'")
	@ApiModelProperty(value = "中奖翻倍ID", example = "c9adb120ca2b48f88626ebd35000fa08")
	private String fid=UUID.randomUUID().toString().replace("-", "");
	
	@Column(columnDefinition = "INT(2) DEFAULT '0' COMMENT '奖励翻倍（-1不支持翻倍、0.未翻倍、1.已经翻倍）'")
	@ApiModelProperty(value = "奖励翻倍（-1不支持翻倍、0.未翻倍、1.已经翻倍）", example = "0")
	private int ftype=0;
	
	@Id
	@Column(columnDefinition = "VARCHAR(20) NOT NULL COMMENT '用户账号ID[9趣猫大转盘中奖历史实体类]'")
	@ApiModelProperty(value = "用户账号ID", example = "fe53d6a4fa29641")
	private String pid;
	
	@Column(columnDefinition = "INT(2) DEFAULT '-1' COMMENT '中奖类型（-1.其他、0.现金豆、101.展示广告红包、102.互动广告红包）'")
	@ApiModelProperty(value = "中奖类型（-1.其他、0.现金豆、101.展示广告红包、102.互动广告红包）", example = "0")
	private int ztype=-1;
	
	@Column(columnDefinition = "INT(2) DEFAULT '-1' COMMENT '中奖类型为现金豆时按钮类型（-1.其他、0.领取礼包、1.继续游戏(无跳转)、2.看视频领取）'")
	@ApiModelProperty(value = "中奖类型为现金豆时按钮类型（-1.其他、0.领取礼包、1.继续游戏、2.看视频领取", example = "0")
	private int btype=-1;
	
	@Id
	@Column(columnDefinition = "INT(2) DEFAULT '-1' COMMENT '抽奖类型（-1.其他、0.抽奖、1.额外奖励'")
	@ApiModelProperty(value = "抽奖类型（-1.其他、0.抽奖、1.额外奖励", example = "0")
	private int dtype=-1;
	
	@Column(columnDefinition = "BIGINT(10) DEFAULT '0' COMMENT '中奖数(现金豆)'")
	@ApiModelProperty(value = "中奖数(现金豆)", example = "100")
	private long dcount;
	
	@Column(columnDefinition = "INT(2) DEFAULT '1' COMMENT '中奖状态，（-1：不结算、0.结算中、1.已结算）'")
	@ApiModelProperty(value = "中奖状态，（-1：不结算、0.结算中、1.已结算）", example = "1")
	private int dstatus;
	
	@Column(columnDefinition = "VARCHAR(20) DEFAULT '-'  COMMENT '最后更新时间'")
	@ApiModelProperty(value = "最后更新时间", example = "2019-02-22 10:10:10")
	private String ltime;
	
	@Column(columnDefinition = "VARCHAR(200) DEFAULT '-' COMMENT '备注'")
	@ApiModelProperty(value = "备注", example = "备注")
	private String info = "-";
	

	public TrunDrawHistory(String pid) {
		super();
		this.pid = pid;
	}

	public TrunDrawHistory(String pid,long dcount) {
		super();
		this.pid = pid;
		this.dcount = dcount;
	}

	public TrunDrawHistory(String ctime, String pid, int ztype, int btype,int dtype, long dcount, String ltime) {
		super();
		this.ctime = ctime;
		this.pid = pid;
		this.ztype = ztype;
		this.btype = btype;
		this.dcount = dcount;
		this.ltime = ltime;
		this.dstatus=1;
		this.dtype = dtype;
	}


	public TrunDrawHistory(String ctime, String pid, int ztype,int dtype, String ltime) {
		super();
		this.ctime = ctime;
		this.pid = pid;
		this.ztype = ztype;
		this.ltime = ltime;
		this.dstatus=1;
		this.dtype = dtype;
	}


	public TrunDrawHistory(String ctime, int ftype, String pid,int ztype, int btype, int dtype, long dcount, int dstatus,
			String ltime) {
		super();
		this.ctime = ctime;
		this.ftype = ftype;
		this.pid = pid;
		this.ztype = ztype;
		this.btype = btype;
		this.dtype = dtype;
		this.dcount = dcount;
		this.dstatus = dstatus;
		this.ltime = ltime;
	}
	
}
